<template>
	<view class="content">
		<swiper class="swiper" :style="{'height':windowHeight}" @animationfinish="animationfinish">
			<swiper-item>
				<image src="../../static/launch.png" style="width: 100vw;height:100vh;" mode="aspectFit"></image>
			</swiper-item>
			<swiper-item>
				<!-- <view class="swiper-item" :style="{'height':windowHeight,'background-color':'green'}">B</view> -->
				<image src="../../static/launch2.png" style="width: 100vw;height:100vh;"></image>
			</swiper-item>
			<swiper-item>
				<image src="../../static/launch3.png" style="width: 100vw;height:100vh;" @click="toPage"></image>
			</swiper-item>
		</swiper>
		<!-- <text :style="{color:'red','font-weight':200}">这是一个sssH1</text> -->
	</view>
</template>
<script>
	export default {
		data() {
			return {
				windowHeight: '603px' //定义手机屏幕高度值变量
			}
		},
		onShow() {
			
		},
		onLoad() {
			// let isGuide = uni.getStorageSync('isGuide')
			// if (isGuide) {
			// 	uni.switchTab({
			// 		url: '/pages/index/index'
			// 	});
			// } else {
			// 	uni.setStorageSync('isGuide', true)
			// }
			
			var _me = this;
			uni.getSystemInfo({ //获取手机屏幕高度信息，让swiper的高度和手机屏幕一样高
				success: function(res) {
					_me.windowHeight = res.windowHeight + 'px';
				}
			});
		},
		methods: {
			animationfinish(e) {
				// //console.log(JSON.stringify(e.detail.current));
				//判断到最后一张后，自动转向进入首页
				if (e.detail.current == 2) {
					setTimeout(function() {
						uni.reLaunch({
							url: '../index/index'
						});
					}, 1000)
				}
			},
			toPage() {
				uni.reLaunch({
					url: '../index/index'
				});
			}
		}
	}
</script>
<style>
	.swiper {
		width: 100%;
		/*     height: 100vw; */
		/* background: red; */
	}
</style>
